//
//  UIFont+SS.m
//  Interesting
//
//  Created by point on 2018/2/8.
//  Copyright © 2018年 whiteboard. All rights reserved.
//

#import "UIFont+SS.h"
#import <UIKit/UIKit.h>
#import <objc/message.h>

#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define FIT_LENGTH(x)  x * ScreenWidth / 375.f

@implementation UIFont (SS)


+ (void)load {
    Method systemFontOfSizeMethod = class_getClassMethod(self, @selector(systemFontOfSize:));
    Method sSystemFontOfSize = class_getClassMethod(self, @selector(sSystemFontOfSize:));
    method_exchangeImplementations(systemFontOfSizeMethod, sSystemFontOfSize);
}

+ (instancetype)sSystemFontOfSize:(CGFloat)fontSize {
    CGFloat fit = FIT_LENGTH(fontSize);
    NSLog(@"改变后的字体大小:%f",fit);
    UIFont *font = [UIFont sSystemFontOfSize:fit];
    return font;
}


@end
